
import axios from 'axios';
exports.GET = (req:any, res:any) => {
    const { songmid } = req.query;
    const filename = `C400${songmid}.m4a`;
    const mp3Url = `https://c.y.qq.com/base/fcgi-bin/fcg_music_express_mobile3.fcg?format=json205361747&platform=yqq&cid=205361747&songmid=${songmid}&filename=${filename}&guid=126548448`;
    axios.get(mp3Url).then((data) => {
        const item = data.data.data.items[0] || {};
        const url = `http://ws.stream.qqmusic.qq.com/${item.filename}?fromtag=0&guid=126548448&vkey=${item.vkey}`;
        res.send({
            code: 200,
            message: 'success',
            data: url
        });
    });
};
